home *** CD-ROM | disk | FTP | other *** search
- on getAbstainAdvice
- global dayNo, bioInfo, stamp, PeakDayNo, endDate, beginDate, basis, advice, relations, previousPeak, mucusNotPeak, bleedPeak
- set basisNo to 0
- set adviceno to 0
- if getAt(stamp, dayNo) = 1 then
- if getOnlyRedPrevious() = 1 then
- set adviceno to 101
- set basisNo to 101
- else
- set PeakDayNo to dayNo
- set bleedPeak to dayNo
- if getAnovulatory() then
- set adviceno to 101
- set basisNo to 103
- else
- if upToNow10(dayNo) then
- set adviceno to 107
- set basisNo to 102
- else
- set adviceno to 101
- set basisNo to 113
- end if
- end if
- end if
- end if
- if getAt(stamp, dayNo) = 2 then
- if upToNow10(dayNo) or start3YellowBabies() then
- set adviceno to 110
- set basisNo to 112
- else
- if dayNo = 1 then
- set adviceno to 101
- else
- if getAt(relations, dayNo - 1) = 4 then
- set adviceno to 102
- else
- set adviceno to 104
- end if
- end if
- set basisNo to 105
- end if
- end if
- if (getAt(stamp, dayNo) = 3) or (getAt(stamp, dayNo) = 10) then
- set adviceno to 101
- if getAt(stamp, dayNo) = 3 then
- set PeakDayNo to 0
- end if
- if dayNo <= previousPeak then
- set basisNo to 125
- else
- set basisNo to 106
- end if
- end if
- if (getAt(stamp, dayNo) = 5) and getAnovulatory() then
- if dayNo = 1 then
- set PeakDayNo to 0
- set basisNo to 103
- set adviceno to 107
- else
- if getAt(stamp, dayNo - 1) = 1 then
- set PeakDayNo to dayNo - 1
- set basisNo to 103
- set adviceno to 107
- else
- set SincePeak to dayNo - PeakDayNo
- set basisNo to 116 + SincePeak
- set adviceno to 106 + SincePeak
- end if
- end if
- end if
- if (getAt(stamp, dayNo) = 4) or ((getAt(stamp, dayNo) = 5) and not getAnovulatory()) then
- set basisNo to 0
- if dayNo = 1 then
- set basisNo to 106
- set adviceno to 101
- else
- if (getAt(mucus, dayNo - 1) < 7) and (getAt(mucus, dayNo - 1) > 1) and (dayNo > (previousPeak + 1)) then
- if getOne(stamp, 10) <> 0 then
- setAt(stamp, getOne(stamp, 10), 3)
- end if
- setAt(stamp, dayNo - 1, 10)
- set PeakDayNo to dayNo - 1
- if the frame <> label("Save Changes") then
- showDays()
- end if
- else
- if getAt(stamp, dayNo - 1) = 3 then
- if getAt(stamp, dayNo) = 5 then
- set PeakDayNo to dayNo - 1
- set basisNo to 115
- else
- set basisNo to 125
- end if
- end if
- end if
- if PeakDayNo > 0 then
- set SincePeak to dayNo - PeakDayNo
- if (basisNo <> 115) and (basisNo <> 125) then
- if not upToNow10(dayNo) or ((dayNo - getOne(stamp, 10)) > 3) then
- set basisNo to 116 + SincePeak
- else
- set basisNo to 106 + SincePeak
- end if
- end if
- set adviceno to 106 + SincePeak
- else
- set adviceno to 101
- if (previousPeak < dayNo) and (dayNo > 3) then
- set basisNo to 126
- else
- set basisNo to 106
- end if
- end if
- end if
- end if
- if getAt(stamp, dayNo) = 6 then
- if not upToNow10(dayNo) then
- if dayNo = 1 then
- set adviceno to 101
- else
- if getAt(relations, dayNo - 1) = 4 then
- set adviceno to 102
- else
- set adviceno to 104
- end if
- end if
- set basisNo to 111
- else
- set adviceno to 110
- set basisNo to 112
- end if
- end if
- if violatedRule() and (adviceno <> 0) then
- set adviceno to adviceno + 1000
- end if
- if inspectbasis(basisNo) then
- append(advice, adviceno)
- append(basis, basisNo)
- else
- append(advice, 500)
- append(basis, 500)
- end if
- end
-
- on getConceiveAdvice
- global dayNo, bioInfo, stamp, PeakDayNo, endDate, beginDate, basis, advice, relations, previousPeak, bleedPeak
- set basisNo to 0
- set adviceno to 0
- if getAt(stamp, dayNo) = 1 then
- if getOnlyRedPrevious() = 1 then
- set adviceno to 101
- set basisNo to 201
- else
- set PeakDayNo to dayNo
- set bleedPeak to dayNo
- if getAnovulatory() then
- set adviceno to 202
- set basisNo to 203
- else
- if upToNow10(dayNo) then
- set adviceno to 202
- set basisNo to 202
- else
- set adviceno to 202
- set basisNo to 113
- end if
- end if
- end if
- end if
- if getAt(stamp, dayNo) = 2 then
- if upToNow10(dayNo) or start3YellowBabies() then
- set adviceno to 110
- set basisNo to 210
- else
- if dayNo = 1 then
- set adviceno to 101
- else
- if getAt(relations, dayNo - 1) = 4 then
- set adviceno to 102
- else
- set adviceno to 104
- end if
- end if
- set basisNo to 205
- end if
- end if
- if (getAt(stamp, dayNo) = 3) or (getAt(stamp, dayNo) = 10) then
- if getAt(stamp, dayNo) = 3 then
- set PeakDayNo to 0
- end if
- if (getAt(mucus, dayNo) < 7) and (getAt(mucus, dayNo) > 2) then
- set adviceno to 105
- else
- set adviceno to 103
- end if
- if dayNo <= previousPeak then
- set basisNo to 226
- else
- set basisNo to 206
- end if
- end if
- if (getAt(stamp, dayNo) = 5) and getAnovulatory() then
- if dayNo = 1 then
- set PeakDayNo to 0
- set basisNo to 203
- set adviceno to 103
- else
- if getAt(stamp, dayNo - 1) = 1 then
- set PeakDayNo to dayNo - 1
- set basisNo to 203
- set adviceno to 103
- else
- set SincePeak to dayNo - PeakDayNo
- set basisNo to 216 + SincePeak
- set adviceno to 103
- end if
- end if
- end if
- if (getAt(stamp, dayNo) = 4) or ((getAt(stamp, dayNo) = 5) and not getAnovulatory()) then
- set basisNo to 0
- set adviceno to 103
- if dayNo = 1 then
- set basisNo to 206
- set adviceno to 103
- else
- if (getAt(mucus, dayNo - 1) < 7) and (getAt(mucus, dayNo - 1) > 1) and (dayNo > (previousPeak + 1)) then
- if getOne(stamp, 10) <> 0 then
- setAt(stamp, getOne(stamp, 10), 3)
- end if
- setAt(stamp, dayNo - 1, 10)
- set PeakDayNo to dayNo - 1
- if the frame <> label("Save Changes") then
- showDays()
- end if
- else
- if getAt(stamp, dayNo - 1) = 3 then
- if getAt(stamp, dayNo) = 5 then
- set PeakDayNo to dayNo - 1
- set basisNo to 215
- else
- set basisNo to 225
- end if
- end if
- end if
- if PeakDayNo > 0 then
- set SincePeak to dayNo - PeakDayNo
- if (basisNo <> 215) and (basisNo <> 225) then
- if not upToNow10(dayNo) or ((dayNo - getOne(stamp, 10)) > 3) then
- set basisNo to 216 + SincePeak
- else
- set basisNo to 206 + SincePeak
- end if
- set adviceno to 103
- end if
- else
- if (previousPeak < dayNo) and (dayNo > 3) then
- set basisNo to 226
- else
- set basisNo to 206
- end if
- end if
- end if
- if (getAt(mucus, dayNo) < 7) and (getAt(mucus, dayNo) > 2) then
- set adviceno to 105
- else
- set adviceno to 103
- end if
- end if
- if getAt(stamp, dayNo) = 6 then
- if not upToNow10(dayNo) then
- if dayNo = 1 then
- set adviceno to 101
- else
- if getAt(relations, dayNo - 1) = 4 then
- set adviceno to 102
- else
- set adviceno to 104
- end if
- end if
- set basisNo to 211
- else
- set adviceno to 110
- set basisNo to 210
- end if
- end if
- if violatedRule() and (adviceno <> 0) then
- set adviceno to adviceno + 1000
- end if
- if inspectbasis(basisNo) then
- append(advice, adviceno)
- append(basis, basisNo)
- else
- append(advice, 500)
- append(basis, 500)
- end if
- end
-